Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Spike "pseudo self serve" feature #2775

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ChrisBAshton
Copy link
Contributor

@ChrisBAshton ChrisBAshton commented Sep 20, 2024

What and Why

Spikes adding a new form to Specialist Publisher, which reads an existing schema and represents it as form(s) with editable values. It then generates JSON which can be used to replace the schema.

The hypothesis is that publishers want to be able to tweak facet names, add facets, etc, and that our current process for making such requests is quite verbose and not well formulated. Whereas if they can provide all the values themselves in exactly the places they'll be needed, they can just give us the JSON and we can open a PR with it (then do all the due diligence around reindexing if the facet name changed, etc).

Longer term, it would also fairly easily pave the way for self-serve where reindexing isn't required (e.g. tweaking the name of the user-facing description, or changing the terms that are used only within Specialist Publisher's UI, etc).

The intention is for this to start off as "pseudo self serve". Departments would be able to make edits to this form, which (without too much extra work) could utilise Support API and generate a Zendesk ticket containing the JSON output, ready for a developer to action. In time, we could also swap out aspects of this for 'true' self-serve - and these 'edit' forms should also form the basis of a form be used for 'new' specialist finders, as opposed to just editing existing ones.

Screenshots

Screenshot of the new '/admin/:document_type' prefix landing page:

Screenshot 2024-09-30 at 09 40 25

Screenshot of the 'edit metadata' form:

Screenshot 2024-09-30 at 09 40 36
Screenshot 2024-09-30 at 09 40 39

Screenshot of the current (temporary) output:

Screenshot 2024-09-30 at 09 42 32

...including diffing:

Screenshot 2024-09-30 at 09 42 46

Screenshot of the facets form:

Screenshot 2024-09-30 at 09 42 55

Trello: https://trello.com/c/ZVtcDFL9/2856-spike-pseudo-self-serve-form-for-specialist-publisher


⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

It's hard to build a pretty or compliant form without the Design
System. This commit (based on what's in Content Publisher) quickly
hacks a layout we can use.
Adds an `/admin/:document_type_slug` path, which reads the config
from the associated schema JSON file, and displays it in basic
form inputs.

Clicking "Generate schema" generates a JSON string which the user
can copy and paste. In theory, this makes requesting edits to
finders easier, as users can see the existing configuration, make
tweaks, and then give us the tweaked configuration in a ready to
use format. It also paves the way for self-serve in future, where
we may want to automatically republish finders after edits.
We can still lean on the "generate a big blob of JSON we can copy
and paste", while splitting the user experience up into more
manageable chunks.
For local dev only

Taking the same CSS and dependency as used in Travel Advice
Publisher.
The linked form currently goes to Tech 2nd Line, but we will
have it go to the publishing queue. See:
https://govuk.zendesk.com/agent/tickets/5930911
<h2>Diff</h2>
<%= Diffy::Diff.new(
JSON.pretty_generate(@original_schema).to_s,
JSON.pretty_generate(@proposed_schema).to_s,

Check notice

Code scanning / Brakeman

Unescaped parameter value. Note

Unescaped parameter value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant